<?php
defined( '_JEXEC' ) or die( 'Restricted access' );#step 2$page_heading = JTEXT::_('WRD_PROFILE_PROFILE');$title = JText::_('WMCVIP_TITLE_PREFIX').$page_heading.JText::_('WMCVIP_TITLE_SUFIX');$document = &JFactory::getDocument();$document->setTitle($title) ;
?>
	<script type="text/javascript">
		jQuery.noConflict();
		jQuery(document).ready(function()
		{
			jQuery("#check_o_a_weekend").click(function(){
				if(jQuery('input#check_o_a_weekend').is(':checked')){
					jQuery('.show_o_a_weekend').removeClass('show_o_a_weekend_none');
					jQuery('.show_o_a_weekend').addClass('show_o_a_weekend_block');
	            }else{
	            	jQuery('.show_o_a_weekend').removeClass('show_o_a_weekend_block');
					jQuery('.show_o_a_weekend').addClass('show_o_a_weekend_none');
	            }
			});
			jQuery('#finish').click(function(){
				jQuery('#continue').val(0);
				var values = new Array();
				jQuery.each($("input[name='hobbies[]']:checked"), function() {
				  values.push($(this).val());
				});
				if(values.length < 3){
										jQuery('#error_message').html('<p><?php echo JText::_('WRD_PROFILE_ALERT_PLEASE_SELECT_AT_LEAST_3_HOBBIES'); ?></p>');					jQuery('#errorModal').modal('show');				}
				else
					 jQuery('#profile-registration').submit();
			});
				
			jQuery('#save_and_continue').click(function(){				alert(123);
				jQuery('#continue').val(1);
				var values = new Array();
				jQuery.each(jQuery("input[name='hobbies[]']:checked"), function() {
				  values.push(jQuery(this).val());
				});
				
				if(values.length < 3)
				{					jQuery('#error_message').html('<p><?php echo JText::_('WRD_PROFILE_ALERT_PLEASE_SELECT_AT_LEAST_3_HOBBIES'); ?></p>');					jQuery('#errorModal').modal('show');				}
				else
					 jQuery('#profile-registration').submit(); 
			});
		});
	</script>
	<style type="text/css">
		.show_o_a_weekend_none{
			display: none ;
		}
		.show_o_a_weekend_block{
			display: block ;
		}
	</style>
<h4 class="all_reward_header"><?php echo $page_heading; ?></h4><div class="panel  panel-wmc">  <div class="panel-heading">    <h3 class="panel-title"><?php echo JText::_('WRD_PROFILE_ACCOUNT_PREFERENCE')?></h3>  </div>  <div class="panel-body">    <p><strong style="color:#3E3061;"><?php echo $this->data->name_on_card; ?></strong></p>    <p><?php echo JText::_('WRD_PROFILE_BALANCE')?>: <span class='link_color'>		<?php echo number_format($this->p_o_u->point,0,'.',',') ;?>		<?php echo JText::_('WRD_PROFILE_POINTS')?> </span></p>	<p><a href="<?php echo JRoute::_('index.php?option=com_wrd&view=profile&layout=myaccount&Itemid=119') ?>">		<?php echo JText::_('WRD_PROFILE_VIEW_THE_SUMMARY_OF_YOUR_POINTS')?></a></p>  </div></div><?php if($this->data->total_step != 4): ?><div class="alert alert-info">	<?php echo JText::_('WRD_HEADER_MESSAGE_STEP2'); ?></div><?php endif; ?><div class="progress" style="display: none">    <?php 	    	if($this->data->user_id != 0)    	{    		$step = $this->data->total_step+1;			    		if($step > 1):                $pointstep = WrdHelper::totalPointOfEachStep($step);            endif;    		switch ($step){    			case 1:    			?>				<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%">    				<?php echo JText::_('WRD_PROFILE_PLEASE_FILL_ALL_FILEDS_OF_THIS_STEP')?>				</div>    			<?php    			break;    			case 2:    			?>          		                <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width: 40%">    				<?php echo JText::_('WRD_PROFILE_POINT_REWARDS_IS_COMMING_TO_YOUR_ACCOUNT_BY_THIS_STEP')?>				</div>    			<?php    				break;    			case 3:    			?>				<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">    				<?php echo JText::_('WRD_PROFILE_POINTS_REWARDS')?>				</div>    			<?php    				break;    			case 4:    			?>				<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%">    				<?php echo JText::_('WRD_PROFILE_POINTS_AND_FINISH')?>				</div>    			<?php    				break;    			case 5:    			?>                <div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width: 100%">    				<?php echo JText::_('WRD_PROFILE_POINTS_AND_FINISH')?>				</div>    			<?php    				break;    		}    	}    ?></div>  <ul class="nav nav-tabs nav-wmc nav-justified">  <li><a href="<?php echo JRoute::_('index.php?option=com_wrd&view=profile&layout=default&id=1&Itemid=170') ?>"><?php echo JText::_('WRD_PROFILE_BASIC_INFOMATION') ?></a></li>  <li class="active"><a href="#">  		<?php echo JText::_('WRD_PROFILE_PERSONAL_INFOMATION') ?></a></li>  <li><a href="<?php echo JRoute::_('index.php?option=com_wrd&view=profile&layout=default&id=3&Itemid=170') ?>">  	<?php echo JText::_('WRD_PROFILE_BIZ_CONTACT') ?></a>  </li>  <li><a href="<?php echo JRoute::_('index.php?option=com_wrd&view=profile&layout=default&id=4&Itemid=170') ?>">  	<?php echo JText::_('WRD_PROFILE_PROFESSIONALISM') ?></a>  </li></ul>    
<div id="profile">
	<form id="profile-registration" name="default_registration_form" class="form-validate" role="form" method="post" action="<?php echo JRoute::_('index.php?option=com_wrd&task=profile.save'); ?>">		<br><br>		<div class="form-group">            <label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$this->configField['status']['caption'])); ?></label>            <?php echo $this->lists['status']; ?>        </div>        <div class="form-group">            <label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$this->configField['website']['caption'])); ?></label>            <input type="text" maxlength="50" size="50" value="<?php echo $this->data->website; ?>" id="website" name="website" title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_website_TIP')); ?>" class="five has-tip tip-right noradius form-control" />        </div>        <div class="form-group">        	<div class="input-group">  				<span class="input-group-addon"><img width="13px;" src="<?php echo $this->icons_path; ?>skype.png" alt="Skype" title="Skype" /></span>            	<input type="text" maxlength="50" size="50" value="<?php echo $this->data->skype; ?>" id="skype" name="skype" title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_SKYPE_TIP')); ?>" class="five has-tip tip-right noradius form-control"  />            </div>        </div>        <div class="form-group">        	<div class="input-group">            	<span class="input-group-addon"><img width="13px;" src="<?php echo $this->icons_path; ?>yahoo.png" alt="Yahoo" title="Yahoo" /></span>            	<input type="text" maxlength="50" size="50" value="<?php echo $this->data->yahoo; ?>" id="yahoo" name="yahoo" title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_YAHOO_TIP')); ?>" class="five has-tip tip-right noradius form-control"  />            </div>         </div>        <div class="form-group">        	<div class="input-group">            	<span class="input-group-addon"><img width="13px;" src="<?php echo $this->icons_path; ?>gtalk.png" alt="Gtalk" title="Gtalk" /></span>            	<input type="text" maxlength="50" size="50" value="<?php echo $this->data->gtalk; ?>" id="gtalk" name="gtalk" title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_GTALK_TIP')); ?>" class="five has-tip tip-right noradius form-control" />            </div>         </div>        <div class="form-group">        	<div class="input-group">            	<span class="input-group-addon"><img width="13px;" src="<?php echo $this->icons_path; ?>msn.png" alt="Window live" title="Window live" /></span>            	<input type="text" maxlength="50" size="50" value="<?php echo $this->data->msn; ?>" id="msn" name="msn" title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_MSN_TIP')); ?>" class="five has-tip tip-right noradius form-control" />         	</div>        </div>        <div class="form-group">        	<div class="input-group">            	<span class="input-group-addon"><img width="13px;" src="<?php echo $this->icons_path; ?>facebook.png" alt="Facebook" title="Facebook" /></span>            	<input type="text" maxlength="50" size="50" value="<?php echo $this->data->facebook; ?>" id="facebook" name="facebook" title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_FACEBOOK_TIP')); ?>" class="five has-tip tip-right noradius form-control" />             </div>        </div>      	<div class="form-group">      <label for="title">      	<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_Hobbies'))?>      </label>    <!-- Script to show/hide child item -->        <style type='text/css'>            .d-block{                display: block ;            }            .d-none{                display: none ;            }        </style>        <script>                jQuery(document).ready(function(){            <?php foreach($this->all_hobbies as $hobbies): ?>                if(jQuery('#item<?php echo $hobbies->id ; ?>').is(":checked"))                {                    jQuery('#item<?php echo $hobbies->id ; ?>').removeClass('d-none');                    jQuery('#item<?php echo $hobbies->id ; ?>').addClass('d-block');                    jQuery('.child_item<?php echo $hobbies->id ; ?>').removeClass('d-none');                    jQuery('.child_item<?php echo $hobbies->id ; ?>').addClass('d-block');                }                jQuery('#item<?php echo $hobbies->id ; ?>').click(function() {                        if(jQuery('#item<?php echo $hobbies->id ; ?>').is(":checked"))                        {                            jQuery('.child_item<?php echo $hobbies->id ; ?>').removeClass('d-none');                            jQuery('.child_item<?php echo $hobbies->id ; ?>').addClass('d-block');                        }else{                            jQuery('.child_item<?php echo $hobbies->id ; ?>').removeClass('d-block');                            jQuery('.child_item<?php echo $hobbies->id ; ?>').addClass('d-none');                        }                    });            <?php endforeach;?>        });    </script>    <!-- End script to show/hide child item -->    <?php  foreach($this->list_hobbies as $hobbies): $tt = $hobbies->id;?>	<div class="checkbox"><label>     <input type="checkbox" <?php echo $this->u_hobbies[$tt] != ''? 'checked="checked"':'';?> value="<?php echo $hobbies->id; ?>" name="hobbies[]" class="hobbies" id="item<?php echo $hobbies->id ; ?>" />     <?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$hobbies->hobbies_name)) ; ?>    </label></div>    <?php endforeach;?>	</div>    <div class="form-group musicform">        <?php             foreach($this->all_hobbies as $a_hobbies):             $flag = $this->list_child_hobbies[$a_hobbies->id] ;            if(count($flag) > 0) : 		        ?>            <label class="d-none child_item<?php echo $a_hobbies->id ; ?> title" >                   <?php echo "<b> ".JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$this->hobbi_name[$a_hobbies->id]->title))." </b>" ; ?>            </label>            <div class="d-none child_item<?php echo $a_hobbies->id ; ?> musictable">                <?php  foreach($flag as $child_hobbies):?>                    <div class="checkbox d-none child_item<?php echo $child_hobbies->parent_id ; ?>">						<label>							<input type="checkbox" <?php echo $this->u_hobbies[$child_hobbies->id] != ''? 'checked="checked"':'';?> value="<?php echo $child_hobbies->id ; ?>" name="hobbies[]" class="hobbies" id="item<?php echo $child_hobbies->id ; ?>" />							<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$child_hobbies->hobbies_name)) ; ?>						</label>                    </div>                <?php endforeach; ?>			</div>        <?php             endif ;            endforeach;        ?>    </div>	<div class="form-group musicform">        <label for="title">            <?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$this->configField['other_hobbies']['caption'])); ?>        </label>        <input type="text" maxlength="50" size="50" value="<?php echo $this->data->other_hobbies; ?>" id="other_hobbies" name="other_hobbies" title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_other_hobbies_TIP')); ?>" class="five has-tip tip-right noradius form-control" />     </div>    <div class="form-group musicform">        <label for="title">            <?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$this->configField['own_car']['caption'])); ?>        </label>        <div class="radio"><label><input type="radio" <?php if($this->data->own_car == 1){ echo "checked='checked'" ; } ?> maxlength="50" size="50" value="<?php echo ($this->data->own_car)?$this->data->own_car:1;?>" name="own_car" /><?php echo JText::_('WRD_PROFILE_STEP2_OWN_CAR_YES'); ?></label></div>        <div class="radio"><label><input type="radio" <?php if($this->data->own_car == 0){ echo "checked='checked'" ; } ?> maxlength="50" size="50" value="<?php echo (!$this->data->own_car)?$this->data->own_car:0;?>" name="own_car" /><?php echo JText::_('WRD_PROFILE_STEP2_OWN_CAR_NO'); ?></label></div>    </td>    <div class="form-group musicform">        <label for="title">        	<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$this->configField['num_children']['caption'])); ?>        </label>        <?php echo $this->lists['numChild']; ?>    </div>	<div class="form-group musicform">        <label for="title"><?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$this->configField['weekend_action']['caption'])); ?></label>        <div class="weekendtable">            <?php foreach($this->list_aweekend as $aweekend): ?>				<div class="checkbox"><label>				<input type="checkbox" <?php echo $this->u_act_w[$aweekend->value] != ''? 'checked="checked"':'';?> value="<?php echo $aweekend->value ; ?>" name="weekend_action[]" class="aweekend" id="item<?php echo $aweekend->value ; ?>" />				<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_'.$aweekend->text)); ?>				</label></div>            <?php endforeach; ?>			<div class="checkbox"><label>               <input type="checkbox" <?php echo $this->data->o_a_weekend != '' ? 'checked="checked"':'';?> value="" id='check_o_a_weekend' name='check_o_a_weekend' />               <?php echo JText::_('WRD_PROFILE_PROFILE_OTHERS') ?>			</label>			</div>   		</div>   </div>   <div class='show_o_a_weekend form-group <?php if(empty($this->data->o_a_weekend)){ echo ' show_o_a_weekend_none';}?>'>		<input type="text" value="<?php echo $this->data->o_a_weekend ; ?> " id='o_a_weekend' size="45" maxlength="45" name='o_a_weekend' title="<?php echo JText::_(WrdHelper::stringURLSafeAliasLang('WRD_PROFILE_STEP2_o_a_weekend_TIP')); ?>" class="has-tip tip-right noradius form-control" />    </div>	<div class="form-group pull-right">        <input type="button" value="<?php echo JText::_('WRD_PROFILE_SAVE_CONTINUE') ?>" id="save_and_continue" name="save_and_continue" class="button_save_and_continue bt btn btn-wmc" />    </div>
	<input type="hidden" name="profile" value="<?php echo $this->data->id ?>">
	<input type="hidden" name="option" value="com_wrd">
	<input type="hidden" name="task" value="profile.save">
	<input type="hidden" id="continue" name="continue" value="">
	<?php echo JHtml::_('form.token');?>
</form></div>